home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)Z / (A)Z7.ADF / C / random / POSTER next >
Text File  |  1986-10-31  |  2KB  |  43 lines

  1. Article 1366 of net.micro.amiga:
  2. Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site unisoft.UUCP
  3. Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amiga.amiga.UUCP
  4. Path: unisoft!lll-lcc!vecpyr!amd!amdcad!amdimage!prls!pyramid!amiga!steve
  5. From: steve@amiga.UUCP (Steve B.)
  6. Newsgroups: net.micro.amiga
  7. Subject: Random numbers
  8. Message-ID: <982@amiga.amiga.UUCP>
  9. Date: 11 Apr 86 19:48:59 GMT
  10. Date-Received: 12 Apr 86 16:20:41 GMT
  11. Reply-To: steve@maryann.UUCP (Steve Beats)
  12. Distribution: net
  13. Organization: Commodore Business Machines, 1200 Wilson Drive, West Chester, PA 19380
  14. Lines: 125
  15.  
  16.  
  17. While browsing through net.micro.amiga the other day, I noticed a simple
  18. random number routine someone had put in thier posting.  This prompted me
  19. to dig through my old 6502 sources for a random number routine I used to
  20. use a lot.  Here, I've converted it from it's old 40 bit format into a 64 bit
  21. format.  I figured you Amigalites out there may find a use for it.  It
  22. appears to have excellent distribution and is OODLES faster than the floating
  23. point equivalents.  I would really be interested if someone who knows all
  24. about random numbers could test out this routine and let me know how good it
  25. is.  I know the old 40 bit version used to repeat once every 8,589,934,592
  26. iterations, thats 272 years worth at one per second.  I have reason to suspect
  27. that a 64 bit version would be better than this.
  28.  
  29. Note: each routine has two entry points, one for assembler and one for C.
  30.       use the same name for both since the Lattice C compiler adds an '_'
  31.       to the front of any external references.
  32.  
  33.       Just assemble this thing (assem rnd.asm -o rnd.obj) and then link
  34.       the object file into your C or assembler program.
  35.  
  36. Well, thats about all, have fun.
  37.  
  38.     Steve Beats
  39.     Commodore Technology
  40.  
  41.  
  42.  
  43.